package com.iknow.activity;

import android.os.AsyncTask.Status;
import android.os.Bundle;
import android.widget.Button;
import com.iknow.IKnow;
import com.iknow.IKnowApiV4;
import com.iknow.app.IKnowSystemConfig;
import com.iknow.data.QingBo;
import com.iknow.http.HttpException;
import com.iknow.task.CommonTask.QingboTask;
import com.iknow.task.TaskParams;
import com.iknow.ui.model.QingBoAdapter;
import com.iknow.util.StringUtil;
import com.iknow.view.widget.PullToRefreshListView;
import java.util.List;
import org.jivesoftware.smack.util.StringUtils;

public class MyQingboActivity extends QingboWithHeaderActivity
{
  private final String TAG = "MyQingboActivity";

  List<QingBo> doGetLocolData()
  {
    List localList1;
    List localList2;
    try
    {
      localList2 = IKnow.mApi.getQingboListByRosterIDLocal(StringUtils.parseName(IKnow.mSystemConfig.getString("account_username")), 0, 20);
      localList1 = localList2;
      return localList1;
    }
    catch (HttpException localHttpException)
    {
      localHttpException.printStackTrace();
      localList1 = null;
    }
  }

  void doNeedMore()
  {
    if ((this.mTask != null) && (this.mTask.getStatus() == AsyncTask.Status.RUNNING));
    while (true)
    {
      return;
      this.mGetMoreButton.setText("正在载入数据...");
      this.mTask = new CommonTask.QingboTask();
      this.mTask.setListener(this.mGetMoreListener);
      this.mTask.setAdapter(this.mAdapter);
      TaskParams localTaskParams = new TaskParams();
      localTaskParams.put("create_user", StringUtils.parseName(IKnow.mSystemConfig.getString("account_username")));
      localTaskParams.put("offset", Integer.valueOf(this.mAdapter.getCount()));
      localTaskParams.put("length", Integer.valueOf(20));
      CommonTask.QingboTask localQingboTask = this.mTask;
      TaskParams[] arrayOfTaskParams = new TaskParams[1];
      arrayOfTaskParams[0] = localTaskParams;
      localQingboTask.execute(arrayOfTaskParams);
    }
  }

  void getServerData()
  {
  }

  void initToolBarText()
  {
    this.mActionButton.setVisibility(8);
    this.mTitle = "我的分享";
  }

  void onActionButtonClickListener()
  {
    refreshData();
  }

  void onBackButtonClickListener()
  {
    finish();
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.PAGE_TYPE = 3;
    getLocolData();
  }

  void refreshData()
  {
    if ((this.mTask != null) && (this.mTask.getStatus() == AsyncTask.Status.RUNNING));
    while (true)
    {
      return;
      String str = IKnow.mSystemConfig.getString("MyQingboActivity");
      if (!(StringUtil.isEmpty(str)))
        this.mListView.setLastUpdated("更新于" + str);
      this.mTask = new CommonTask.QingboTask();
      this.mTask.setListener(this.mTaskListener);
      this.mTask.setAdapter(this.mAdapter);
      TaskParams localTaskParams = new TaskParams();
      localTaskParams.put("create_user", StringUtils.parseName(IKnow.mSystemConfig.getString("account_username")));
      localTaskParams.put("offset", Integer.valueOf(0));
      localTaskParams.put("length", Integer.valueOf(20));
      CommonTask.QingboTask localQingboTask = this.mTask;
      TaskParams[] arrayOfTaskParams = new TaskParams[1];
      arrayOfTaskParams[0] = localTaskParams;
      localQingboTask.execute(arrayOfTaskParams);
    }
  }
}